package com.cskaoyan.day03.stack;

/**
 * @author stone
 * @date 2022/01/30 09:23
 */
public class StackHomework {

    public static void main(String[] args) {
        LinkedStack<Character> stack = new LinkedStack<>();
        //练习 字符串反转 → 作业 Character  String chatAt
        String target = "hello";
        for (int i = 0; i < target.length(); i++) {
            char x = target.charAt(i);
            stack.push(x);
        }
        StringBuffer stringBuffer = new StringBuffer();
        while (!stack.isEmpty()) {
            stringBuffer.append(stack.pop());
        }
        System.out.println(stringBuffer.toString());
    }
}
